package com.yonyougov.devops.cruxcisupport.k8s.secret;

import com.yonyougov.devops.cruxcisupport.k8s.error.K8sConfIgNotFindException;
import io.fabric8.kubernetes.api.model.Secret;

import java.util.Map;

public interface SecretRepository {
    /**
     * 创建安全密钥
     * @param secretRequest 参数
     * @return Secret
     */
    Secret createOrReplace(SecretRequest secretRequest) throws K8sConfIgNotFindException;

    /**
     * 获取安全密钥
     * @param name 名称
     * @param nameSpace 命名空间
     * @return Secret
     */
    Secret get(String name, String nameSpace) throws K8sConfIgNotFindException;

    boolean delete(String secretName,String nameSpace) throws K8sConfIgNotFindException;
}
